package com.xt.dao;

import com.xt.bean.Course;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

/**
 * Created by XT on 2018/5/3.
 */
public interface CourseRepository extends MongoRepository<Course,String> {

    Page<Course> findByDepartmentId(String departmentId, Pageable pageable);

    Page<Course> findByNameLike(String name, Pageable pageable);

    Page<Course> findByDepartmentIdAndNameLike(String departmentId, String name, Pageable pageable);

    Page<Course> findByDepartmentIdAndSpecialtyId(String departmentId, String specialtyId, Pageable pageable);

    Page<Course> findByDepartmentIdAndSpecialtyIdAndNameLike(String departmentId, String specialtyId, String name, Pageable pageable);

}
